<?php
defined('SEJUJOPEFDNGJSL') or exit('Access denied');
class config {
	var $db;

	public function __construct(){
		global $db;
		$this->db = &$db;
	}	

	public function getregconfig($s=' show_when_reg=0'){
		$r=array();
		$this->db->query("select * from ld_regconfig where $s");
		foreach ($this->db->rs as $k => $v) {
			if(strstr($v['field_option'],'|')){
				$r[$v['field_name']]=explode('|',$v['field_option']);
			}else{
				$r[$v['field_name']]=$v['field_option'];
			}
		}
		return $r;
	}	

	public function getregmust($s=' show_when_reg=0'){
		$r=array();
		$this->db->query("select * from ld_regconfig where $s");
		foreach ($this->db->rs as $k => $v) {
			$r[$v['field_name']]=$v['is_must_input'];
		}
		return $r;
	}	

	public function getpwd(){
		$r=array();
		$this->db->query("select * from ld_regconfig where show_when_reg=0 and input_type=3");
		foreach ($this->db->rs as $k => $v) {
			$r[$v['field_name']]=$v['field_meaning'];
		}
		return $r;
	}
	//取得密保
	public function getmb(){
		$this->db->query("select field_option from ld_regconfig where field_name='rgmbq'",2);
		return explode('|',$this->db->rs['field_option']);
	}	
	public function getmben(){
		$this->db->query("select field_option from ld_regconfig where field_name='rgmbqen'",2);
		return explode('|',$this->db->rs['field_option']);
	}		
}
?>